import {setLocalStorage, LANGKEY} from '@/utils/auth.js';

export const state = () => ({
    locales: ['en', 'zh'],
    locale: 'en',
    isMobile: false
  })
export const mutations = {
  SET_LANG(state, locale) {
      if (state.locales.indexOf(locale) !== -1) {
        setLocalStorage(LANGKEY, locale);
        state.locale = locale;
      }
  },
  SET_IS_MOBILE(state, isMobile){
    state.isMobile = isMobile;
  }
}